import os
os.mkdir('语文')
os.chair('语文')
data_list = ['语法','诗词','古文','写作','外国文学']
for data in data_list:
    filename = data + '.txt'
    file = open(filename,'w')
    file.close()
path = os.getcwd()
print(os.listdir(path))
os.remove('外国文学.txt')
os.mkdir('外国文学')
file_name = os.listdir(path)
print(file_name)
i = 1
for name in file_name:
    if '.txt' in name:
        new_name = str(i) + name
        os.rename(name,new_name)
        i += 1
print(os.listdir(path))

import os
print(os.getcwd())
os.mkdir('os_text')
os.chdir('os_text')
os.mkdir('mk_text')
f = open('1.txt','w')
f.close()
os.rename('1.txt','2.txt')
os.chdir('D:\\pycharmProjects\\项目七')
print(os.listdir('os_test'))
os.rmdir('os_text\\mk_test')
print(os.listdir('os.text'))
os.remove('os_test\\2.txt')
print(os.listdir('os_test'))
